package com.kaili.basic.mapper;


import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.kaili.basic.pojo.dto.MdmCompanyQueryDto;
import com.kaili.basic.pojo.entity.MdmCompany;
import com.kaili.basic.pojo.entity.MdmCompanyExport;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  MdmCompanyMapper 接口
 * </p>
 *
 * @author fzj
 * @since 2018-05-09
 */
@Mapper
public interface MdmCompanyMapper extends BaseMapper<MdmCompany> {

    //新增公司
    int addMdmCompany(MdmCompany mdmCompany);

    //修改公司
    int updateMdmCompany(MdmCompany mdmCompany);

    //删除公司
    int deleteMdmCompany(MdmCompany mdmCompany);

    //根据查询条件分页查询公司
    List<MdmCompany> getMdmCompanyByKeywords(Pagination page, MdmCompanyQueryDto dto);

    //根据查询条件查询公司
    MdmCompany getMdmCompanyByKeywords1(MdmCompany mdmCompany);

    //导出
    List<MdmCompanyExport> queryCompanyExport(MdmCompanyQueryDto dto);

    //查询当前最新公司编号
    List<MdmCompany> getCompanyCode();

    //查询公司url
    MdmCompany getCompanyUrl(@Param("companyId") Long companyId);

    Integer getCodeById(@Param("id")Integer id);

    //查询公司当天最大货量
    Double getMaxWeight();
    //查询公司已经创建帐号
    Integer getMaxUser();

    //通过手机号码 来查询是否已经注册
    Integer selectPhone(String phoneNumber);

    String getImgByKey(String key);

    Integer getCompanyCodeByAuto();

    void createdCompanyCodeAuto(Map<String,Object> map);

    void updateCompanyCodeStatusUsed(Integer companyCode);

    void updateCompanyCodeStatusUsing(Integer companyCode);

    void updateCompanyCodeStatusUnuse(Integer companyCode);
}
